import { _decorator, Component, Node, sp } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('EnterRole')
export class EnterRole extends Component {
    private _skAnimation: sp.Skeleton;
    start() {
        this._skAnimation = this.node.getComponentInChildren(sp.Skeleton);
    }
    setHide() {
        this.node.active = false;
    }
    public playAnimation(deley?: number) {
        this.node.active = true;
        if (deley) {
            this.scheduleOnce(() => {
                this._skAnimation?.setAnimation(0, 'appear', false);

            }, deley);
        } else {
            this._skAnimation?.setAnimation(0, 'appear', false);
        }
    }
    update(deltaTime: number) {

    }
}


